home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ASME's Mechanical Engine…ing Toolkit 1997 December
/
ASME's Mechanical Engineering Toolkit 1997 December.iso
/
win_eng
/
atre27.exe
/
ATREE_27
/
EXAMPLE2.LF
< prev
next >
Wrap
Text File
|
1992-08-01
|
3KB
|
88 lines
#
#
#---- example2.lf
#!!!! requires example1.lf to be run first !!!!
#
#---- This is an lf example that tests both the XOR, NXOR,
#---- and AND functions of two binary inputs learned in
#---- example1.lf.
#
#---- The trees saved into the file example1.tre are used with
#---- the encodings from the file example1.cod.
#---- Note that a saved set of trees must be accompanied
#---- by its corresponding encodings if the tree is to function
#---- properly in future trials where the trees are loaded
#---- instead of generated.
#
#---- specify tree statements
tree
#---- test on trees generated in example1.lf
load tree from "example1.tre"
#---- specify function statements
function
#---- domain dimension must be the first statement, followed
#---- by the codomain dimension
domain dimension = 2
#---- we are testing on 3 functions at once, XOR, NXOR, and AND
#---- which means there are 3 codimensions
codomain dimension = 3
#---- load encoding generated in example1.lf for use with example1.tre
load coding from "example1.cod"
#---- there are no rows in our training set
#---- note that there is NO "training set =" statement
training set size = 0
#---- we will test on the following 4 vectors
test set size = 4
test set =
# A B A xor B A nxor B A and B
1 1 0 1 1
1 0 1 0 0
0 1 1 0 0
0 0 0 1 0
#---- The following output file should be generated:
#---- The first line indicates how many codomains there are.
#---- The next four lines represent each of the four lines in the test set.
#---- Each value is followed by its corresponding quantization number
#---- in the prescribed encoding scheme. Each codomain is followed
#---- by the corresponding result from the ALN's, along with its quantization
#---- number. Remember, it's not the calculated value that is as important
#---- as the calculated quantization level. You can get more accurate values
#---- by tightening up the encoding: increasing the number of quantization
#---- levels.
#---- After the results is the error histogram, which counts for each
#---- of the codomains the number of times the result quantization
#---- level differed from the actual quantization level by n. In this example,
#---- the ALN's executed the test set perfectly, so there are 4 counts for
#---- errors of n = 0 in each of the 3 codomains.
# A B A xor B A xor B result A nxor B A nxor B result A and B A and B result
#3
#1.000000 1 1.000000 1 0.000000 0 0.000000 0 1.000000 1 1.000000 1 1.000000 1 1.000000 1
#1.000000 1 0.000000 0 1.000000 1 1.000000 1 0.000000 0 0.000000 0 0.000000 0 0.000000 0
#0.000000 0 1.000000 1 1.000000 1 1.000000 1 0.000000 0 0.000000 0 0.000000 0 0.000000 0
#0.000000 0 0.000000 0 0.000000 0 0.000000 0 1.000000 1 1.000000 1 0.000000 0 0.000000 0
#
#ERROR HISTOGRAM
#0 errors 4 4 4
#1 errors 0 0 0
#2 errors 0 0 0
#3 errors 0 0 0
#4 errors 0 0 0
#5 errors 0 0 0
#6 errors 0 0 0
#7 errors 0 0 0
#8 errors 0 0 0
#9+ errors 0 0 0